package com.lemontree.spring3.Aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Pointcut;

/**
 * 定义环绕通知
 */
public class Audience02 {

    @Pointcut("execution(* com.lemontree.spring4.day02.Performance.perform(..))")
    public void perform(){}

    @Around("perform()")
    public void warchperform(ProceedingJoinPoint proceedingJoinPoint){
        try {
            System.out.println("silencing cell phone1");
            proceedingJoinPoint.proceed();
            System.out.println("Clap ...");
        } catch (Throwable throwable) {
            System.out.println("Demanding a refund");
        }
    }

}
